Dynomotion

Group: DynoMotion Message: 8676 From: Hugh Sontag Date: 11/17/2013
Subject: Fan fault
Hi Tom,

I was running a GCode program that drills a hole using a helix. I found that the program doesn't always complete due to a fault on my SnapAmp SNAP1.

So I wrote a C function to monitor faults on the board. I've included the C source for the function at the end of this email. Originally, I thought that I was getting an overcurrent fault, but it wasn't clear which channel this was occurring.

The program let me know that the first fault that occurs is "Fan". Here is its output:

SNAP1 fault: Fan
Following Error Disabled Axis:2

Axis 2 (Y) and axis 3 (Z) are on SNAP1. I have noticed that it isn't the same axis every time that is disabled due to following error. Sometimes it's axis 2 and sometimes it's axis 3.

I have run this GCode program probably 20 times, and I don't get a fault every time. The fault does not occur at exactly the same place in the movement of the CNC router, but I have noticed that is always occurs more than 1/3 of the way through the movement; in other words, never right away.

The entire movement probably takes about 40 seconds. After it's done, the machine is quiescent for 1 - 2 minutes before moving again.

The board was purchased about 3 months ago. How can I go about diagnosing what the root cause of the fault is?

Thanks,
Hugh

int Snap1FaultExists = 0;

static void CheckSnap(int whichSnap)
{
int s, currentA, currentC;

s = ReadSnapAmp(whichSnap + SNAP_STATUS);

if ((s & 1) != 0) {
if (Snap1FaultExists == 0) {
Snap1FaultExists = 1;
if (s & 2) {
currentA = ReadSnapAmp(whichSnap + SNAP_CURRENT_A0);
currentC = ReadSnapAmp(whichSnap + SNAP_CURRENT_C0);
printf("SNAP1 fault: Y Axis (0) over current, A0 = %d, C0 = %d\n", currentA, currentC);
}
if (s & 4) {
currentA = ReadSnapAmp(whichSnap + SNAP_CURRENT_A1);
currentC = ReadSnapAmp(whichSnap + SNAP_CURRENT_C1);
printf("SNAP1 fault: Z Axis (1) over current, A1 = %d, C1 = %D\n", currentA, currentC);
}
if (s & 8) {
printf("SNAP1 fault: Over Temp 0 (Y Axis)\n");
}
if (s & 0x10) {
printf("SNAP1 fault: Over Temp 1 (Z Axis)\n");
}
if (s & 0x20) {
printf("SNAP1 fault: Fan\n");
}
}
} else if (Snap1FaultExists) {
if ((Y_CHAN->Enable == 0) && (Z_CHAN->Enable == 0)) {
Snap1FaultExists = 0;
printf("Re-enabled Snap Amp fault checking.\n");
}
}

} // CheckSnap

Group: DynoMotion Message: 8681 From: Tom Kerekes Date: 11/17/2013
Subject: Re: Fan fault
Hi Hugh,

The Fan Status isn't really a fault.  It just reports if the fan is turned on.  SnapAmp turn on the fans whenever the measured temperature of the FETs is above 40C.

I'm not sure the ReadSnapAmp() function is thread safe/interrupt safe.  It was only intended for low level diagnostics.  If an interrupt occurs during a read SnapAmp communtication might get corrupted.  If you use it make sure you do a WaitNextTimeSlice() soon before it so you are guaranteed to complete the read un-interrupted.

Is it something special about the GCode Helix?  Does it occur in other cases?  Can you get it to fail from moves on the step response screen?

If it only happens on the GCode I would recommend capturing data to a file.  There is an example called: CaptureXYZMotionToFile.c.  It normally only captures the commanded motion, but you can expand it to include more things like the encoder positions (ch0->Position), Axis Output, or motor currents.   The motor current should exist in memory in the Array ADC_BufferInSnap[], offsets 8-11.

HTH
Regards
TK


Group: DynoMotion Message: 8684 From: Hugh Sontag Date: 11/17/2013
Subject: Re: Fan fault
Hi Tom,

The problem I need to solve is faulting on my SNAP1.

Please tell me,:

--> Under what condition is the "Fault" bit set in the SnapAmp status?

--> When are the other bits set? (OverTemp1,OverTemp0,OVER_CUR1,OVER_CUR0)

--> I would have thought that if the "Fault" bit was set, the status word would contain a bit that identified the source of the fault. What really happens?

The fault occurs when moving both Y and Z axes. I would like to know which channel caused the fault. Is there a way to know that?

You mention that the motor currents should be in ADC_BufferInSnap[]. Is this array updated every time slice? If not, how often does the data change?

I am interested in the units of the values for motor current read from the SnapAmp. When I examine KMotionDef.h, it suggests that full-scale is 4.85 Amps, but the SnapAmp is supposed to be capable of 

It appears that the fault occurs when moving both Y and Z, but necessarily at exactly the same place in the movement. Also, I have successfully completed the entire movement without a fault.

Using the Step Response screen to move either axis does not trigger a fault.

I want to establish the source of the fault to avoid chasing the wrong problem. If I have to, I'll characterize the conditions leading up to the fault.

---

--> What do the little boxes on the right side of the "Axis" window show? I suspect it's motor current. What condition causes the box to be red? Should I be concerned if the box flashes red on occasion, but a fault is not triggered?

--> I've noticed that sometimes, after a Z axis can move, the motor current shown in the "Analog Status" window can  be as high as 6, 8 or 10 amps, and the axis is not moving. Is this a cause for concern? I would have thought that the holding current for the motor, once the axis stops moving, shouldn't be this high.


Thanks,
Hugh


On Sun, Nov 17, 2013 at 3:04 PM, Tom Kerekes <tk@...> wrote:
 

Hi Hugh,

The Fan Status isn't really a fault.  It just reports if the fan is turned on.  SnapAmp turn on the fans whenever the measured temperature of the FETs is above 40C.

I'm not sure the ReadSnapAmp() function is thread safe/interrupt safe.  It was only intended for low level diagnostics.  If an interrupt occurs during a read SnapAmp communtication might get corrupted.  If you use it make sure you do a WaitNextTimeSlice() soon before it so you are guaranteed to complete the read un-interrupted.

Is it something special about the GCode Helix?  Does it occur in other cases?  Can you get it to fail from moves on the step response screen?

If it only happens on the GCode I would recommend capturing data to a file.  There is an example called: CaptureXYZMotionToFile.c.  It normally only captures the commanded motion, but you can expand it to include more things like the encoder positions (ch0->Position), Axis Output, or motor currents.   The motor current should exist in memory in the Array ADC_BufferInSnap[], offsets 8-11.

HTH
Regards
TK


Group: DynoMotion Message: 8685 From: Tom Kerekes Date: 11/17/2013
Subject: Re: Fan fault
Hi Hugh,

See below: